package lock_thread;

import java.util.Date;
import java.util.concurrent.locks.LockSupport;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/5/9
 * Time:15:52
 * LockSupport休眠
 **/
public class Demo12 {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程进入休眠：" + new Date());
                LockSupport.parkUntil(System.currentTimeMillis()+1000);
                System.out.println("线程终止休眠：" + new Date());
            }
        }).start();
    }
}
